<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>BitMobile Ltd.</title>
    
    <jsp:useBean id="partList" class="com.bm.repair.list.PartList" />


    <link rel="stylesheet" href="stylesheets/main.css"/>
</head>

<body>
    <div id="content">
        <h1>Order repair</h1>
        <form method="post" action="quote">
            <label for="vehicleType">Vehicle type</label>
            <select name="vehicleSize">
                <option value="S">Small</option>
                <option value="M">Medium</option>
                <option value="L">Large</option>
            </select>
            <br />
            <br />

            <% 
                // Listing parts
                for ( int i = 0; i < partList.size(); i++) {
                    out.println("<input type=\"checkbox\" name=\"parts\" id=\"" + partList.get(i).getId() + "\" value=\"" + partList.get(i).getName().getValue() +"\" />");
                    out.println("<label for=\"" + partList.get(i).getId() + "\">" + partList.get(i).getName().getValue() + "</label>");
                    out.println("<br />");
                    
                }
            %>

            <br />
            <label for="firstName">First name</label><br />
            <input type="text" name="firstName" />
            
            <br /><br />
            <label for="lastName">Last name</label><br />
            <input type="text" name="lastName" />
            
            <br /><br />
            <label for="email">Email</label><br />
            <input type="email" name="email" />
            <br />
            <br />

            <input type="submit" value="Order"/>
        </form>
    </div>

</body>
</html>